package common 
{
	import debug.ASSERT;
	/**
	 * 人员数据
	 * @author anod
	 */
	public class StructStaff implements IData
	{
		private var mName:String;
		private var mIdentity:String;
		private var mID:int;
		
		public function StructStaff( id:int ) 
		{
			mID = id;
		}
		
		/* INTERFACE common.IData */
		
		public function loadFromXML(xml:XML):void 
		{
			ASSERT( xml != null, "加载的xml为空" );
			
			//<item name="xxoo" identity="xxoo"/>
			mName = String( xml.@name );
			mIdentity = String(xml.@identity);
		}
		
		public function toXML():String 
		{
			return '<item name="' + mName + '" identity="' +mIdentity + '"/>';
		}
		
		public function get name():String 
		{
			return mName;
		}
		
		public function set name(value:String):void 
		{
			ASSERT( value != null, "人员名称不能为空" );
			mName = value;
		}
		
		public function get identity():String 
		{
			return mIdentity;
		}
		
		public function set identity(value:String):void 
		{
			mIdentity = value;
		}
		
		public function get ID():int 
		{
			return mID;
		}
		
	}

}